package processors;

import java.awt.image.renderable.ParameterBlock;

import javax.media.jai.JAI;
import javax.media.jai.PlanarImage;
import javax.media.jai.operator.MedianFilterDescriptor;

public class MedianProcessor extends Processor<PlanarImage, PlanarImage> {

	@Override
	public void process(PlanarImage image) {
		ParameterBlock pb = new ParameterBlock();
		pb.addSource(image);
		pb.add(MedianFilterDescriptor.MEDIAN_MASK_SQUARE);
		pb.add(4);
		setOutput(JAI.create("MedianFilter", pb));
	}
}
